<script setup lang="ts">
import { ref } from 'vue'
import { useTransition } from '@vueuse/core'
const props = defineProps({
  startVal: {
    type: Number,
    default: 0
  },
  endVal: {
    type: Number,
    default: 100
  },
  duration: {
    type: Number,
    default: 1000
  }
})

const countTo = ref(0)
const outputValue = useTransition(countTo, {
  duration: props.duration
})
countTo.value = props.endVal
</script>

<template>
  <el-statistic :value="outputValue" v-bind="$attrs" />
</template>
